import requests
import configparser
import os


# 创建配置解析器对象
config = configparser.ConfigParser()

# 读取配置文件，参数为配置文件路径
config.read(filenames='.../configparser配置文件相关/config.ini')


def xinhe_login(base_url):
    url = f'{base_url}admin/shop/machine/getMachineInfoBySnCode'
    param = {"snCode": os.getenv('SN_CODE', 'DA89236141297')}
    res = requests.get(url=url, params=param)
    return res.json()['data']['authorization']


person = {
  "name": "张三",
  "age": 30
};

print(xinhe_login(config['url']['url']))